home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir37 / pull70.zip / STRS.PAS < prev    next >
Pascal/Delphi Source File  |  1993-06-21  |  2KB  |  61 lines

  1. { ========================================================================== }
  2. { Strs.pas - accesses Str procedure for use as a           ver 7.0, 06-21-93 }
  3. {            function.                                                       }
  4. { Inline code keeps function from having to copy the string twice and thus   }
  5. { increasing speed.  Functions save code in the long run.                    }
  6. {  Copyright (C) 1993 James H. LeMay, All rights reserved.                   }
  7. { ========================================================================== }
  8.  
  9. UNIT Strs;
  10.  
  11. INTERFACE
  12.  
  13. function StrL   (L: longint):                       string;
  14. function StrLF  (L: longint; Field: integer):       string;
  15. function StrR   (R: real):                          string;
  16. function StrRF  (R: real; Field: integer):          string;
  17. function StrRFD (R: real; Field,Decimals: integer): string;
  18.  
  19.  
  20. IMPLEMENTATION
  21.  
  22. function StrL; { (L: longint): string; }
  23. var  Result: ^string;
  24. begin
  25. Inline(                  { Typical code: }
  26.   $89/$EC/               { mov  sp,bp      ; Drop Result }
  27.   $16/                   { push ss         ; Result segment }
  28.   $FF/$76/$0A);          { push [bp+$0A]   ; Result offset ($08 for near) }
  29.   str (L,Result^);
  30. end;
  31.  
  32. function StrLF; { (L: longint; Field: integer): string; }
  33. var  Result: ^string;
  34. begin
  35.   Inline ($89/$EC/$16/$FF/$76/$0C);
  36.   str (L:Field,Result^);
  37. end;
  38.  
  39. function StrR; { (R: real): string; }
  40. var  Result: ^string;
  41. begin
  42.   Inline ($89/$EC/$16/$FF/$76/$0C);
  43.   str (R,Result^);
  44. end;
  45.  
  46. function StrRF; { (R: real; Field: integer): string; }
  47. var  Result: ^string;
  48. begin
  49.   Inline ($89/$EC/$16/$FF/$76/$0E);
  50.   str (R:Field,Result^);
  51. end;
  52.  
  53. function StrRFD; { (R: real; Field,Decimals: integer): string; }
  54. var  Result: ^string;
  55. begin
  56.   Inline ($89/$EC/$16/$FF/$76/$10);
  57.   str (R:Field:Decimals,Result^);
  58. end;
  59.  
  60. END.
  61.